<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<topic id="topic1" xml:lang="en"><title id="ho143896">pg_shdepend</title><body><p>The <codeph>pg_shdepend</codeph> system catalog table records the dependency relationships
      between database objects and shared objects, such as roles. This information allows Greenplum Database to ensure that those objects are unreferenced before attempting to
      delete them. See also <xref href="pg_depend.xml#topic1">pg_depend</xref>, which performs a
      similar function for dependencies involving objects within a single database. Unlike most
      system catalogs, <codeph>pg_shdepend</codeph> is shared across all databases of Greenplum system: there is only one copy of <codeph>pg_shdepend</codeph>
      per system, not one per database.</p><p>In all cases, a <codeph>pg_shdepend</codeph> entry indicates that
the referenced object may not be dropped without also dropping the dependent
object. However, there are several subflavors identified by <codeph>deptype</codeph>:
</p><ul><li id="ho156091"><b>SHARED_DEPENDENCY_OWNER (o)</b> — The referenced object (which
must be a role) is the owner of the dependent object.</li><li id="ho156094"><b>SHARED_DEPENDENCY_ACL (a)</b> — The referenced object (which must
be a role) is mentioned in the ACL (access control list) of the dependent
object.</li><li id="ho156097"><b>SHARED_DEPENDENCY_PIN (p)</b> — There is no dependent object; this
type of entry is a signal that the system itself depends on the referenced
object, and so that object must never be deleted. Entries of this type
are created only by system initialization. The columns for the dependent
object contain zeroes.<table id="ho143898"><title>pg_catalog.pg_shdepend</title><tgroup cols="4"><colspec colnum="1" colname="col1" colwidth="131pt"/><colspec colnum="2" colname="col2" colwidth="86pt"/><colspec colnum="3" colname="col3" colwidth="85pt"/><colspec colnum="4" colname="col4" colwidth="147pt"/><thead><row><entry colname="col1">column</entry><entry colname="col2">type</entry><entry colname="col3">references</entry><entry colname="col4">description</entry></row></thead><tbody><row><entry colname="col1"><codeph>dbid</codeph></entry><entry colname="col2">oid</entry><entry colname="col3">pg_database.oid</entry><entry colname="col4">The OID of the database the dependent object
is in, or zero for a shared object.</entry></row><row><entry colname="col1"><codeph>classid</codeph></entry><entry colname="col2">oid</entry><entry colname="col3">pg_class.oid</entry><entry colname="col4">The OID of the system catalog the dependent
object is in.</entry></row><row><entry colname="col1"><codeph>objid</codeph></entry><entry colname="col2">oid</entry><entry colname="col3">any OID column</entry><entry colname="col4"> The OID of the specific dependent object.</entry></row><row><entry colname="col1"><codeph>objsubid </codeph></entry><entry colname="col2">int4</entry><entry colname="col3"/><entry colname="col4">For a table column, this is the column number.
For all other object types, this column is zero.</entry></row><row><entry colname="col1"><codeph>refclassid</codeph></entry><entry colname="col2">oid</entry><entry colname="col3">pg_class.oid</entry><entry colname="col4">The OID of the system catalog the referenced
object is in (must be a shared catalog).</entry></row><row><entry colname="col1"><codeph>refobjid</codeph></entry><entry colname="col2">oid</entry><entry colname="col3">any OID column</entry><entry colname="col4">The OID of the specific referenced object.</entry></row><row><entry colname="col1"><codeph>refobjsubid </codeph></entry><entry colname="col2">int4</entry><entry colname="col3"/><entry colname="col4">For a table column, this is the referenced column
number. For all other object types, this column is zero.</entry></row><row><entry colname="col1"><codeph>deptype</codeph></entry><entry colname="col2">char</entry><entry colname="col3"/><entry colname="col4">A code defining the specific semantics of this
dependency relationship.</entry></row></tbody></tgroup></table></li></ul></body></topic>